/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package py.sysbi.entidades;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author PROYECTO_2
 */
@Entity
@Table(name = "diagnostico_detalle")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "DiagnosticoDetalle.findAll", query = "SELECT d FROM DiagnosticoDetalle d"),
    @NamedQuery(name = "DiagnosticoDetalle.findByDiagnostico", query = "SELECT d FROM DiagnosticoDetalle d WHERE d.diagnosticoDetallePK.diagnostico = :diagnostico"),
    @NamedQuery(name = "DiagnosticoDetalle.findById", query = "SELECT d FROM DiagnosticoDetalle d WHERE d.diagnosticoDetallePK.id = :id"),
    @NamedQuery(name = "DiagnosticoDetalle.findBySintoma", query = "SELECT d FROM DiagnosticoDetalle d WHERE d.sintoma = :sintoma")})
public class DiagnosticoDetalle implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected DiagnosticoDetallePK diagnosticoDetallePK;
    @Size(max = 255)
    @Column(name = "sintoma")
    private String sintoma;

    public DiagnosticoDetalle() {
    }

    public DiagnosticoDetalle(DiagnosticoDetallePK diagnosticoDetallePK) {
        this.diagnosticoDetallePK = diagnosticoDetallePK;
    }

    public DiagnosticoDetalle(int diagnostico, int id) {
        this.diagnosticoDetallePK = new DiagnosticoDetallePK(diagnostico, id);
    }

    public DiagnosticoDetallePK getDiagnosticoDetallePK() {
        return diagnosticoDetallePK;
    }

    public void setDiagnosticoDetallePK(DiagnosticoDetallePK diagnosticoDetallePK) {
        this.diagnosticoDetallePK = diagnosticoDetallePK;
    }

    public String getSintoma() {
        return sintoma;
    }

    public void setSintoma(String sintoma) {
        this.sintoma = sintoma;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (diagnosticoDetallePK != null ? diagnosticoDetallePK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DiagnosticoDetalle)) {
            return false;
        }
        DiagnosticoDetalle other = (DiagnosticoDetalle) object;
        if ((this.diagnosticoDetallePK == null && other.diagnosticoDetallePK != null) || (this.diagnosticoDetallePK != null && !this.diagnosticoDetallePK.equals(other.diagnosticoDetallePK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.sysbi.entidades.DiagnosticoDetalle[ diagnosticoDetallePK=" + diagnosticoDetallePK + " ]";
    }
    
}
